#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>

#define N 100001
#define mod 100003

using namespace std;

int dp[N];

int main(){
    memset(dp, 0, sizeof(dp));
    dp[0] = 1; dp[1] = 1;
    int n, k;
    cin >> n >> k;
    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= min(i, k); j++){
            dp[i] = (dp[i] + dp[i - j]) % mod;
        }
    }
    cout << dp[n];
    return 0;
}